const proxy = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(proxy("/api", { 
       target: "http://yermn.xiayulin.cn/" ,
       secure: false,
       changeOrigin: true,
       pathRewrite: {
        // "^/api": "/api"
       },
       // cookieDomainRewrite: "http://localhost:3000"
    }));
  app.use(proxy("/storage", { 
       target: "http://yermn.xiayulin.cn/" ,
       secure: false,
       changeOrigin: true,
       pathRewrite: {
        // "^/api": "/api"
       },
       // cookieDomainRewrite: "http://localhost:3000"
    }));
};